package com.shd.edanpei.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.shd.edanpei.R;
import com.shd.edanpei.enums.UrlEnum;
import com.shd.edanpei.util.ScreenUtils;

/**
 * Created by mc on 2018/12/4.
 * yang-wen-wen
 */

public class FullDialogActivity extends Activity {

    private ImageView ivImage;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_full_dialog);

        Bundle extras = getIntent().getExtras();
        String image = extras.getString("image");
        final String name  = extras.getString("name");
        final String url = extras.getString("url");

        ivImage = findViewById(R.id.iv_image);

        Glide.with(this).load(image).into(ivImage);

        findViewById(R.id.iv_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        ivImage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                WebActivity.start(FullDialogActivity.this, name, url, UrlEnum.a.getType());
                finish();

            }
        });
    }

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(R.anim.trans_center_in, R.anim.trans_center_out);
    }


}
